# !/usr/bin/env python3
from flask import Flask
from login import login
from flask import request
from flask_sqlalchemy import SQLAlchemy
import pymysql
pymysql.install_as_MySQLdb()
MYSQL_NAME = 'synu'
MYSQL_PASSWORD = '971016w.'
MYSQL_HOST = '49.232.58.155'
MYSQL_POST = '3306'
MYSQL_DBNAME = 'synu'
MYSQL_CHARSET = 'utf8'
SQLALCHEMY_DATABASE_URI = 'mysql://{}:{}@{}:{}/{}'.format(MYSQL_NAME,MYSQL_PASSWORD,
                                                                     MYSQL_HOST,MYSQL_POST,
                                                                     MYSQL_DBNAME)

app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = SQLALCHEMY_DATABASE_URI
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = True
# 查询时会显示原始SQL语句
app.config['SQLALCHEMY_ECHO'] = True

db = SQLAlchemy(app)
